# url地址？后面的东西都市请求参数
# https://www.baidu.com/s?wd=abc
import requests
url = "https://www.baidu.com/s?"
# 将参数的kv放到字典当中
keyword = {"wd": "nba"}
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36"}
resp = requests.get(url, params=keyword, headers=headers)
print(resp.text)